<!doctype html>
<html lang="en" xmlns:p="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap demo</title>
    <link href="/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
</head>
<body>
<div align="center"><h1>teachers管理系统登录界面</h1></div>

<table class="table table-striped">
    <tr>
        <td>id</td>
        <td>name</td>
        <td>password</td>
        <td>sex</td>
        <td>birthday</td>
        <td>courseName</td>
        <td>professional</td>
    </tr>
    <tr th:each="teacher:${teachers}">
        <td th:text="${teacher.id}"></td>
        <td th:text="${teacher.name}"></td>
        <td th:text="${teacher.password}"></td>
        <td th:text="${teacher.sex==0?'女':'男'}"></td>
        <td th:text="${teacher.birthday}"></td>
        <td th:text="${teacher.cname}"></td>
        <td th:text="${teacher.professional}"></td>
        <td><a th:href="@{/Teacher/delete.do(id=${teacher.id})}">删除</a>
            <a th:href="@{/Teacher/toUpdate.do(id=${teacher.id})}">修改</a>
        </td>
    </tr>
</table>
<nav aria-label="Page navigation example">
    <ul class="pagination justify-content-end">
        <li class="page-item ">
            <a class="page-link" th:if="${not pageInfo.isFirstPage}"
               th:href="@{${'/Student/list.do'}(pageNum=${1},pageSize=${pageInfo.pageSize})}">
                首页
            </a>
            <a class="page-link" th:if="${pageInfo.isFirstPage}" href="javascript:void(0);">
                首页
            </a>
        </li>
        <li class="page-item ">

            <a class="page-link" th:if="${not pageInfo.isFirstPage}"
               th:href="@{${'/Student/list.do'}(pageNum=${pageInfo.pageNum-1},pageSize=${pageInfo.pageSize})}">
                前页
            </a>
            <a class="page-link" th:if="${pageInfo.isFirstPage}" href="javascript:void(0);">
                前页
            </a>
        </li>
        <li class="page-item " th:each="pageNo : ${pageInfo.navigatepageNums}">
            <a class="page-link" th:if="${pageInfo.pageNum eq pageNo}" href="javascript:void(0);">
                <span th:text="${pageNo}"></span>
            </a>

            <a class="page-link" th:if="${not (pageInfo.pageNum eq pageNo)}"
               th:href="@{${'/Student/list.do'}(pageNum=${pageNo},pageSize=${pageInfo.pageSize})}">
                <span th:text="${pageNo}"></span>
            </a>
        </li>

        <li class="page-item ">
            <a class="page-link" th:if="${not pageInfo.isLastPage}"
               th:href="@{${'/Student/list.do'}(pageNum=${pageInfo.pageNum+1},pageSize=${pageInfo.pageSize})}"
               aria-label="Next">
                下一页
            </a>
            <a class="page-link" th:if="${pageInfo.isLastPage}" href="javascript:void(0);" aria-label="Next">
                下一页
            </a>
        </li>
        <li class="page-item ">
            <a class="page-link" th:if="${not pageInfo.isLastPage}"
               th:href="@{${'/Student/list.do'}(pageNum=${pageInfo.pages},pageSize=${pageInfo.pageSize})}">
                最后一页
            </a>
            <a class="page-link" th:if="${pageInfo.isLastPage}" href="javascript:void(0);">
                最后一页
            </a>
        </li>
    </ul>
</nav>
<div align="center"><a href="#" class="list-group-item" onclick="loadPage('/Teacher/toAdd.do')">增加教师</a></div>
<script src="/bootstrap/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
</body>
</html>